using System;

using Microsoft.SPOT;
using Microsoft.SPOT.Input;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using System.Globalization;
using System.Reflection;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.Presentation.Shapes;
using System.Collections;
using System.Threading;

namespace MicroSnake
{
    public class Program : Microsoft.SPOT.Application
    {
        public static void Main()
        {
            // TODO: Load culture from flash memory otherwise set default culture
            Util.SetCulture("en");

            Program myApplication = new Program();

            Window mainWindow = myApplication.CreateWindow();

            // Create the object that configures the GPIO pins to buttons.
            GPIOButtonInputProvider inputProvider = new GPIOButtonInputProvider(null);

            // Start the application
            myApplication.Run(mainWindow);
        }

        private Window mainWindow;

        public Window CreateWindow()
        {
            // Create a window object and set its size to the size of the display.
            mainWindow = new Window();
            mainWindow.Height = SystemMetrics.ScreenHeight;
            mainWindow.Width = SystemMetrics.ScreenWidth;
            mainWindow.Background = new LinearGradientBrush(MicroSnakeColors.BackgroundMenuColor, 
                                                            Color.White, 
                                                            0, 0, 0, mainWindow.Height + 100);
            mainWindow.Visibility = Visibility.Visible;

            ScreenManager screenManager = ScreenManager.Create(mainWindow);
            screenManager.ShowSplashScreen();
            
            return mainWindow;
        }
    }
}
